﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;
using MDL;

namespace BLL
{
    public class BLL_RoomType
    {
        /// <summary>
        /// 查询所有房间的类型
        /// </summary>
        /// <returns>所有房间列表</returns>
        public static List<RoomType> SelectRoomType()
        {
            return DAL_RoomType.SelectRoomType();
        }
        /// <summary>
        /// 根据房间类型查最低消费
        /// </summary>
        /// <param name="name">房间名</param>
        /// <returns>最低消费</returns>
        public static object SelectRoomTypeXiaoFei(string name)
        {
            return DAL_RoomType.SelectRoomTypeXiaoFei(name);
        }
        /// <summary>
        /// 下拉绑定房间类型
        /// </summary>
        /// <returns>房间类型</returns>
        public static List<RoomType> BangDinRoomType()
        {
            return DAL_RoomType.BangDinRoomType();
        }
        /// <summary>
        /// 查询是否已有相同的房间类型名称
        /// </summary>
        /// <param name="name">要查询的房间类型名称</param>
        /// <returns>是否有</returns>
        public static List<RoomType> GetRoomType(string name)
        {
            return DAL_RoomType.GetRoomType(name);
        }
        /// <summary>
        /// 增加房间类型
        /// </summary>
        /// <param name="name">房间名称</param>
        /// <param name="xf">最低消费</param>
        /// <param name="dz">是否打折</param>
        /// <param name="rs">容纳人数</param>
        /// <returns>受影响的行数</returns>
        public static int AddRoomType(string name, int xf, int dz, int rs)
        {
            return DAL_RoomType.AddRoomType(name, xf, dz, rs);
        }
        /// <summary>
        /// 删除房间类型
        /// </summary>
        /// <param name="name">根据房间名称</param>
        /// <returns>受影响的行数</returns>
        public static int DeleteRoomType(string name)
        {
            return DAL_RoomType.DeleteRoomType(name);
        }
        /// <summary>
        /// 修改房间类型
        /// </summary>
        /// <param name="name">房间名称</param>
        /// <param name="xf">最低消费</param>
        /// <param name="dz">是否打折</param>
        /// <param name="rs">容纳人数</param>
        /// <param name="name1">根据房间名称</param>
        /// <returns>受影响的行数</returns>
        public static int UpdateRoomType(string name, int xf, int dz, int rs, string name1)
        {
            return DAL_RoomType.UpdateRoomType(name, xf, dz, rs, name1);
        }
        /// <summary>
        /// 根据餐台ID查询房间名称和最低消费
        /// </summary>
        /// <param name="ID">餐台ID</param>
        /// <returns>房间名称和最低消费</returns>
        public static List<RoomType> SelectName(int ID)
        {
            return DAL_RoomType.SelectName(ID);
        }
    }
}
